﻿class PrimeNumbers

{

    static void Main()

    {

        int count = 0;

        for (int i = 101; i <= 200; i++)

        {

            if (IsPrime(i))

            {

                Console.Write(i + " ");

                count++;

            }

        }

        Console.WriteLine();

        Console.WriteLine(count);

    }



    static bool IsPrime(int number)

    {

        if (number <= 1) return false;

        if (number == 2) return true;

        if (number % 2 == 0) return false;



        int boundary = (int)Math.Floor(Math.Sqrt(number));



        for (int i = 3; i <= boundary; i += 2)

        {

            if (number % i == 0)

                return false;

        }



        return true;

    }

}

